﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace SqliteDAL.Migrations
{
    /// <inheritdoc />
    public partial class My040102 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "T_Projects",
                columns: table => new
                {
                    Id = table.Column<long>(type: "INTEGER", nullable: false)
                        .Annotation("Sqlite:Autoincrement", true),
                    Manufacturer = table.Column<string>(type: "TEXT", nullable: false),
                    ProjectPriorityId = table.Column<int>(type: "INTEGER", nullable: false),
                    SampleSize = table.Column<double>(type: "REAL", nullable: false),
                    DilutionModeId = table.Column<int>(type: "INTEGER", nullable: false),
                    DilutionRatio = table.Column<string>(type: "TEXT", nullable: false),
                    Row = table.Column<int>(type: "INTEGER", nullable: false),
                    Col = table.Column<int>(type: "INTEGER", nullable: false),
                    Name = table.Column<string>(type: "TEXT", nullable: false),
                    X = table.Column<double>(type: "REAL", nullable: false),
                    Y = table.Column<double>(type: "REAL", nullable: false),
                    Z = table.Column<double>(type: "REAL", nullable: false),
                    MaxZ = table.Column<double>(type: "REAL", nullable: false),
                    UpdateTime = table.Column<string>(type: "TEXT", nullable: false),
                    IsUse = table.Column<bool>(type: "INTEGER", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Projects", x => x.Id);
                    table.ForeignKey(
                        name: "FK_T_Projects_T_DataDictinarys_DilutionModeId",
                        column: x => x.DilutionModeId,
                        principalTable: "T_DataDictinarys",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_T_Projects_T_DataDictinarys_ProjectPriorityId",
                        column: x => x.ProjectPriorityId,
                        principalTable: "T_DataDictinarys",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                });

            migrationBuilder.CreateIndex(
                name: "IX_T_Projects_DilutionModeId",
                table: "T_Projects",
                column: "DilutionModeId");

            migrationBuilder.CreateIndex(
                name: "IX_T_Projects_ProjectPriorityId",
                table: "T_Projects",
                column: "ProjectPriorityId");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "T_Projects");
        }
    }
}
